{__NOLAYOUT__}
<include file="Public/meta"/>
        
        

        <div class="container-fluid">
            <div class="row-fluid">
                    
<div class="btn-toolbar">
    <button class="btn btn-primary" id="submit"><i class="icon-save"></i> 提交</button>
    <!-- <a href="#myModal" data-toggle="modal" class="btn">删除</a> -->
  <div class="btn-group">
  </div>
</div>
<div class="well">
    
    <div id="myTabContent" class="tab-content">
      <div class="tab-pane active in" id="home">
    <form id="tab" method="post">
        <label>产品名称</label>
        <input type="text" value="{$data.pro_name}" class="input-xlarge" id="pro_name" name='pro_name'>
    
        <label>产品类别</label>
        <select name="category" id="category" class="input-xlarge">
          <volist name='cate_list' id='vo'>
            <option value="{$vo.cate_id}" <if condition="$vo.cate_id eq $cate_id">selected</if>>{$vo.catename}</option>
          </volist>
         
        </select>
       
     
    </form>
      </div>
      
  </div>

</div>

<div class="modal small hide fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">Delete Confirmation</h3>
  </div>
  <div class="modal-body">
    
    <p class="error-text"><i class="icon-warning-sign modal-icon"></i>Are you sure you want to delete the user?</p>
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
    <button class="btn btn-danger" data-dismiss="modal">Delete</button>
  </div>
<!-- </div> -->



<script type="text/javascript">

  function pro_na_blur(){
      var pro_name = $('#pro_name').val();
      if(pro_name==''){
        layer.msg('产品名称必须！',{icon:2,time:1000});return false;
      }else{
        return true;
      }
  }

  function inven_blur(){
    var inventory = $('#inventory').val();
      if(inventory==''){
        layer.msg('库存必须！',{icon:2,time:1000});return false;
      }else{
        return true;
      }
  }


  $('#pro_name').blur(function(){
      pro_na_blur();
  })

  $('#inventory').blur(function(){
     inven_blur();
  })


  $("#submit").click(function(){
 

      //提交前确认信息无误
      if(pro_na_blur()){
        if(inven_blur()){
          $.post("",$("#tab").serialize(),function(msg){
              if(msg.code=='1'){
                layer.msg(msg.info,{icon:1,time:1000},function(index){
                  window.parent.location.reload();
                });

              }else{
                layer.msg(msg.info,{icon:2,time:1000});
                return false;
              }

          })
        }
      }
      


      
  })
  
</script>